<div class="row">
    <?php $form=$this->beginWidget('CActiveForm', array(
        'id'=>'data-_form-form',
        'enableAjaxValidation'=>false,
        'enableClientValidation'=>false,
        'clientOptions'=>array(  
            'validateOnSubmit'=>false,  
         ),
         'htmlOptions'=>array('class'=>'form-horizontal')
    )); ?>
    <?php
    if( !empty($forminfo) ){
    foreach( $forminfo as $sFiedl=>$aVal ){
    ?>
    <div class="control-group">
        <label class="control-label"><?php echo $aVal['name']; ?><?php echo $aVal['require']==1 ? '<s>*</s>' : '' ?>：</label>
        <div class="controls control-row-auto span-width span12">
            <?php echo $aVal['form']; ?> 
        </div>
    </div>
    <?php    
    }    
    }
    ?>
    
    <?php $this->endWidget(); ?>
</div>
<script type="text/javascript">
var charset = '<?php echo Yii::app()->db->charset; ?>';
var Form = BUI.Form;      
new Form.Form({
    srcNode : '#data-_form-form'
}).render();
$("input").keypress(function (e) {  
    var keyCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;  
    if (keyCode == 13) {
        return false;       
    }
}
function ruselinkurl() {
    if($('#islink').attr('checked')=='checked') {
            $('#linkurl').attr('disabled',false); 
    } else {
            $('#linkurl').attr('disabled','true');
    }
}
function strlen_verify(obj, checklen, maxlen) {
	var v = obj.value, charlen = 0, maxlen = !maxlen ? 200 : maxlen, curlen = maxlen, len = strlen(v);
	for(var i = 0; i < v.length; i++) {
		if(v.charCodeAt(i) < 0 || v.charCodeAt(i) > 255) {
			curlen -= charset == 'utf-8' ? 2 : 1;
		}
	}
	if(curlen >= len) {
		$('#'+checklen).html(curlen - len);
	} else {
		obj.value = mb_cutstr(v, maxlen, true);
	}
}
function mb_cutstr(str, maxlen, dot) {
	var len = 0;
	var ret = '';
	var dot = !dot ? '...' : '';
	maxlen = maxlen - dot.length;
	for(var i = 0; i < str.length; i++) {
		len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1;
		if(len > maxlen) {
			ret += dot;
			break;
		}
		ret += str.substr(i, 1);
	}
	return ret;
}
function strlen(str) {
	return ($.browser.msie && str.indexOf('\n') != -1) ? str.replace(/\r?\n/g, '_').length : str.length;
}
</script>
<!-- script start--> 
    <script type="text/javascript">
        
    </script>
<!-- script end -->

  </div>